//button 组件
import { defineComponent, PropType, ref } from 'vue';
import s from "./Button.module.scss"
// interface Props {
//     onClick?:(e: MouseEvent) => void,
//     //弥补tsx报错（startpage 里面的onclick报错）

// }
export const Button = defineComponent({
    props: {
        onClick: {
            type: Function as PropType<(e: MouseEvent) => void>
        },
        type: {
            type: String as PropType<'submit' | "button">
        }
    },
    setup(props, context) {
        return () => (
            <button type={props.type} class={s.button} onClick={props.onClick}>
                {context.slots.default?.()}
                {/*获取默认插槽  */}
            </button>
        );
    }
})